<?php
/**
 * Created by PhpStorm.
 * User: wanghaibo
 * Date: 18/3/26
 * Time: 16:22
 */

namespace App\Http\Api\Admin;


use App\Http\API\ApiController;
use App\Services\Admin\UserAccountService;
use App\Services\Admin\UserService;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;

class UserAccountApiController extends ApiController
{
    protected $service;
    public function __construct(UserAccountService $service)
    {
        $this->service = $service;
    }

    /**
     * @param Request $request
     * @return array
     */
    protected function validator(Request $request){
        return $this->validate(
            $request,
            [
                'password' => 'required|min:6|confirmed',
                'email'     => 'required|unique:users',
                'token' => 'required',
            ]
        );
    }
    public function lists(Request $request){
        return $this->success(1,$this->service->lists($request));
    }
}